package com.wanpinghui.wphlibrary.model.user.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;

/**
 * 功能描述
 * author:caitiangui
 * time:2017/11/23
 */

public class BusinessTypeBean implements Parcelable {
    private String key;
    private String name;
    private boolean isSelect;

    public BusinessTypeBean(String key, String name) {
        this.key = key;
        this.name = name;
    }

    public BusinessTypeBean(String key, String name, boolean isSelect) {
        this.key = key;
        this.name = name;
        this.isSelect = isSelect;
    }

    protected BusinessTypeBean(Parcel in) {
        key = in.readString();
        name = in.readString();
        isSelect = in.readByte() != 0;
    }

    public static final Creator<BusinessTypeBean> CREATOR = new Creator<BusinessTypeBean>() {
        @Override
        public BusinessTypeBean createFromParcel(Parcel in) {
            return new BusinessTypeBean(in);
        }

        @Override
        public BusinessTypeBean[] newArray(int size) {
            return new BusinessTypeBean[size];
        }
    };

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getKey() {
        return key;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(key);
        dest.writeString(name);
        dest.writeByte((byte) (isSelect ? 1 : 0));
    }
}
